CC = gcc

CFLAGS := 
CFLAGS += -Wall

# y: open debug; n close debug
DEBUG = y
ifeq ($(DEBUG), y)
	CFLAGS += -DDEBUG
	CFLAGS += -O  # develop version: "-O" is needed to expand inlines
else
	CFLAGS += -O2 # release version
endif

OBJECTS = config.o wraps.o error.o utils.o server.o

all: topsail 

topsail: $(OBJECTS)
	$(CC) $(OPTIONS) config.o wraps.o server.o utils.o error.o -o ../topsail

.PHONY: clean
clean:
	rm -rf $(OBJECTS) topsail
